<?php
require_once "common.php";
class redirector{
	//转向地址
	private $address;
	//转向等待时间
	private $time;
	//传递的提示信息
	private $msg;
	//构造函数初始化
	function __construct($address,$time,$msg){
		if(is_string($address)&&is_int($time)&&is_string($msg)){
			if($address!=""&&$time!=""&&$msg!=""){
				$this->address=$address;
				$this->time=$time;
				$this->msg=$msg;
			}
		}
	}
	public function redirect(){
		echo "<script>location.href=\"./location.php?address=".$this->address."&time=".$this->time."&msg=".$this->msg."\"</script>";
		//echo "<script src=\"./js/go.js\" language=\"javascript\" type=\"text/javascript\"></script>";
		//echo "<span id=\"tiao\">".$this->time."</span>秒后自动跳转<script language=javascript>countDown(".$this->time.",'".$this->address."');</script>";
	}

}
//测试
//$redirector=new redirector('./index.php',3,'1231231231231');
//$redirector->redirect();
?>